// Prototypes:
void Level1Item1Sub1_Text(void);
void Level1Item1Sub1_Func(void);

// Menus:
MAKE_MENU(Level1Item1    , Level1Item2, Level1Item3, NULL_ENTRY , Level1Item1Sub1, NULL_FUNC           , NULL_FUNC           , "ITEM 1");
MAKE_MENU(Level1Item2    , Level1Item3, Level1Item1, NULL_ENTRY , NULL_ENTRY     , NULL_FUNC           , NULL_FUNC           , "ITEM 2");
MAKE_MENU(Level1Item3    , Level1Item1, Level1Item2, NULL_ENTRY , NULL_ENTRY     , NULL_FUNC           , NULL_FUNC           , "ITEM 3");

MAKE_MENU(Level1Item1Sub1, NULL_ENTRY , NULL_ENTRY , Level1Item1, NULL_ENTRY     , Level1Item1Sub1_Func, Level1Item1Sub1_Text, NULL_TEXT);

// Functions:
void Level1Item1Sub1_Text(void)
{
	char Buffer[] = "*YNAMIC MENU TEXT";

	Buffer[0] = 'D';

	LCD_Write_SRAM_String(Buffer);
}

void Level1Item1Sub1_Func(void)
{
	Shutdown_App();
}

int main (void)
{
	Setup_Joystick();
	LCD_Initialize();
	SET_MENU_WRITE_FUNC(LCD_Write_PROGMEM_String);

	SET_MENU(Level1Item1);

	for (;;)
	{
		switch (JoystickVal)
		{
			case JOY_LEFT:
				SET_MENU(PARENT);		
				break;
			case JOY_RIGHT:
				SET_MENU(SIBLING);		
				break;
			case JOY_UP:
				SET_MENU(PREVIOUS);		
				break;
			case JOY_DOWN:
				SET_MENU(NEXT);		
				break;
			case JOY_PRESSED:
				GO_MENU_FUNC(SELECTFUNC);		
				break;
		}

		AVR_Sleep();
	}	
}